﻿namespace ElisVK.Splash
{
    using System;
    using System.Windows;

    public static class Splasher
    {
        private static Window _mSplash;

        public static Window Splash
        {
            get
            {
                return _mSplash;
            }
            set
            {
                _mSplash = value;
            }
        }

        public static void ShowSplash()
        {
            if ( _mSplash != null )
            {
                _mSplash.Show();
            }
        }

        public static void CloseSplash()
        {
            if (_mSplash != null)
            {
                _mSplash.Close();

                if (_mSplash is IDisposable)
                    ((IDisposable) _mSplash).Dispose();
            }
        }
    }
}
